<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="clock"> </div>
		<script type="text/javascript">
			//3.使用js做一个电子表, 显示当前时间，格式为: yyyy-mm-dd hh:mm:ss, 并能够随时间跳动，可以参考js时间对象。
			let clock = document.getElementById('clock');
			setInterval(function() {
				var time = new Date();
				// console.log(time)
				var year = time.getFullYear();
				var month = time.getMonth() + 1;
				var day = time.getDate();
				var hour = time.getHours();
				var minute = time.getMinutes();
				var second = time.getSeconds();
				clock.innerHTML = year + '年' + month + '月' + day + '日' + hour + '时' + minute + '分' + second + '秒';
			}, 1000)
		</script>
	</body>
</html>
